package com.easy.west.westclient.api.constacts.api;

import com.easy.west.westclient.api.constacts.bean.HumanList;
import com.easy.west.westclient.api.constacts.bean.PersonBean;
import com.easy.west.westclient.api.constacts.bean.PersonInfo;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * 人员请求
 * Created by xiatao on 2018/8/15.
 */

public interface ConstactsService
{
    /**
     * 查找对应部门下的所有人员
     * @param did
     * @return
     */
    @GET("addressbooks/bydep/{dep}")
    Call<HumanList> findPeopleByDepartMent(@Path("dep") long did);

    /**
     * 查询指定联系人的详情
     * @param aid
     * @return
     */
    @GET("ddressbooks/{aid}")
    Call<PersonInfo> findPeopleinfo(@Path("aid")long aid);

    /***
     * 查找所有的联系人
     * @return
     */
    @GET("addressbooks/all")
    Call<HumanList> findAllPeople();

    /***
     * 判断联系人是否被绑定
     * @param aid
     * @return
     */
    @GET("addressbooks/isBundle/{aid}")
    Call<Boolean> findPeopleislink(@Path("aid")long aid);

    /**
     *
     * @param name
     * @return
     */
    @FormUrlEncoded
    @POST("addressbooks/findlike")
    Call<HumanList> queryCosntacts(@Field("name") String name);

    /***
     *
     * @param uid
     * @return
     */
    @GET("addressbooks/findbyuid/{uid}")
    Call<PersonInfo> findpersonbyuid(@Path("uid")long uid);

}
